﻿#include <iostream>
#include <vector>

using namespace std;

// 应用FIR滤波器
vector<double> apply_fir_filter(const vector<double>& signal, const vector<double>& coefficients) {
    int N = signal.size();
    int M = coefficients.size();
    vector<double> filtered(N, 0.0);

    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < M; ++j) {
            if (i - j >= 0) {
                filtered[i] += coefficients[j] * signal[i - j];
            }
        }
    }
    return filtered;
}